<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子15-JS进阶（二）</title>
    </head>
    <body class="cols">
        <pre>
            <code>
                    // 例子15

                    var a = 20;

                    function fn(a) {
                        a = a + 10;
                        return a;
                    }
                    fn(a); // 30
                    console.log(a); // 20
            </code>
        </pre>
        <pre>
            <code>
                    var a = { m: 10, n: 20 }
                    function fn(a) {
                        a.m = 20;
                        return a;
                    }

                    fn(a); // { m: 20, n: 20 }
                    console.log(a);   // { m: 20, n: 20 }
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/15.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>